Question: The average of 12, 21 and $x$ is 18. What is the value of $x$?
Solution: We have

$$\frac{12+21+x}{3}=18\Rightarrow 33+x=54$$

So $x=\boxed{21}$.